<template>
  <el-tabs v-model="activeName" @tab-click="handleClick">
    <el-tab-pane label="修改信息" name="first">
      <form-first :form="form" ref="first"></form-first>
    </el-tab-pane>
    <el-tab-pane label="我的上级" name="third">
      <form-third :queryParams="queryParams"></form-third>
    </el-tab-pane>
    <el-tab-pane label="我的下级" name="fourth">
      <form-fourth :queryParams="queryParams"></form-fourth>
    </el-tab-pane>
    <el-tab-pane label="我的流水记录" name="fifth">
      <form-fifth :queryParams="queryParams"></form-fifth>
    </el-tab-pane>
    <el-tab-pane label="我的消费券记录" name="consume">
      <form-consumer :queryParams="queryParams"></form-consumer>
    </el-tab-pane>
    <el-tab-pane label="我的积分记录" name="sixth">
      <form-sixth :queryParams="queryParams"></form-sixth>
    </el-tab-pane>
    <el-tab-pane label="我的佣金记录" name="brokerage">
      <form-brokerage :queryParams="queryParams"></form-brokerage>
    </el-tab-pane>
    <el-tab-pane label="收货地址" name="second">
      <form-second :queryParams="queryParams"></form-second>
    </el-tab-pane>
    <el-tab-pane label="资金统计" name="profit" v-if="checkPermi(['member:manager.statistics'])">
      <form-profit :queryParams="queryParams"></form-profit>
    </el-tab-pane>

  </el-tabs>
</template>

<script>
import formFirst from "./formFirst.vue";
import formSecond from "./formSecond.vue";
import formThird from "./formThird.vue";
import formFourth from "./formFourth.vue";
import formFifth from "./formFifth.vue";
import formSixth from "./formSixth.vue";
import formConsumer from './formConsumer.vue'
import formBrokerage from "./formBrokerage.vue";
import FormBrokerage from "./formBrokerage.vue";
import formProfit from './formProfit.vue'
import FormProfit from "./formProfit.vue";
import { checkPermi } from "@/utils/permission";
export default {
  components: { formFirst, formSecond, formThird, formFourth, formFifth, formSixth, formConsumer, formBrokerage, FormBrokerage, formProfit, FormProfit },
  props: {
    form: { type: Object }
  },
  data() {
    return {
      activeName: 'first',
      queryParams: {
        userId: this.form.id,
        inviteCode: this.form.inviteCode,
        pageNum: 1,
        pageSize: this.global.pageSize
      },
      addressInfo: [],
    };
  },
  watch: {
    "form": {
      deep: true,
      handler: function (newV, oldV) {
        this.queryParams.userId = this.form.id;
        this.queryParams.inviteCode = this.form.inviteCode;
      },
    },
  },
  mounted() {
    // this.params.userId = this.form.id
  },

  methods: {
    checkPermi,
    handleClick(tab, event) {

    }
  }
};
</script>
